import {
	defineStore
} from 'pinia'
import {
	ref,
	reactive
} from 'vue'

export const useConfigStore = defineStore('config', () => {
	const config = ref()
	const systemBarInfo = ref()
	const setConfig = (val) => {
		config.value = val
	}
	const getSystemInfo = (val) => {
		const statusBarHeight = uni.getSystemInfoSync().statusBarHeight; //系统信息里的状态栏高度
		const {
			top,
			left,
			height,
			width
		} = uni.getMenuButtonBoundingClientRect(); //胶囊按钮信息
		systemBarInfo.value = {
			statusBarHeight,
			top,
			left,
			height,
			width
		}
	}
	return {
		config,
		setConfig,
		systemBarInfo,
		getSystemInfo
	}
})